package com.canyou.system.entity.menu;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 菜单新增编辑模型
 *
 * @author fy
 * @date 2021/5/24 16:39
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "MenuDTO", description = "菜单新增编辑模型")
public class MenuDTO {

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty("上级菜单id")
    @NotNull(message = "上级菜单id不能为空")
    private Long parentId;

    @ApiModelProperty("菜单/按钮名称")
    @NotBlank(message = "菜单/按钮名称不能为空")
    private String title;

    @ApiModelProperty("菜单URL")
    private String url;

    @ApiModelProperty("权限标识")
    @NotBlank(message = "权限标识不能为空")
    private String permission;

    @ApiModelProperty("图标")
    private String icon;

    @ApiModelProperty("菜单类型（0菜单  1 按钮(弹出)  2按钮(新开)）")
    @NotNull(message = "菜单类型不能为空")
    @Range(min = 0, max = 2, message = "菜单类型值为0-2")
    private Integer type;

    @ApiModelProperty("菜单排序")
    private Integer sort;

    @ApiModelProperty(value = "乐观锁版本")
    private Long version;

}
